We will discuss hereinafter the disadvantages of prior art considering the special case of onboard comparators in a micro controller used in a slaving system.
Slaving systems are systems for which the output is equal to a set value as closely as possible. To achieve this, these systems use a feedback from the output of the system to its input, so that the measured signal at the output from the system (also called the comparator input signal) can be compared with a set value.
Therefore, it is normal that a slaving system comprises a micro controller equipped with a comparator that, after detecting an equality (or non-equality) between the input signal and the set value, generates a comparison signal (also called output signal in the remainder of this description), for example to directly modify execution of a slaving algorithm, to change the state of some outputs of the system or to control capture of a value of a counter that will be used by the algorithm to adjust system controls.
A very large number of comparison techniques are known to generate an output signal representing a difference between an input signal and a set value. This comparison signal varies between high and low logic levels as a function of the result of the comparison.
As illustrated on FIG. 1, the comparison with a “threshold” is a first technique according to which the output signal OUTPUT—1 switches over to the high logic level VCC when the input signal INPUT is greater than or equal to the set value VCONS, and to the low logic level VSS when the input signal INPUT is less than the set value VCONS.
This relatively old comparison technique has not been very successful for different reasons, and particularly sensitivity to noise.
The presence of a noisy signal at the comparator input may cause random operation or system failure, because when the noisy signal becomes close to the set value, the so-called one-threshold comparator generates unstable controls CMD_INST.
To overcome this problem, an analogue hysteresis is traditionally used on the comparator so that noise carried by the input signal is not retransmitted to the system.
More precisely and as illustrated in FIG. 1, a comparator with hysteresis (or a “two-threshold” comparator) (also called a Schmitt trigger) is characterized by two switching thresholds: a low switching threshold VIL and a high switching threshold VIH. According to this second technique, when the input signal INPUT reaches the high switching threshold VIH, the output signal OUTPUT—2 switches from the low logic level VSS to the high logic level VCC and when the input signal INPUT reaches the low switching threshold VIL, the output signal OUTPUT—2 switches from the high logic level VCC to the low logic level VSS.
Note that as the difference between the high switching threshold VIH and the low switching threshold VIL becomes greater, the comparator becomes more reliable and insensitive to parasite fluctuations superimposed on the input signal INPUT. This voltage difference between the two switching thresholds VIH and VIL is called hysteresis. The difference between the high switching threshold VIH and the low switching threshold VIL also forms the margin of immunity to noise that is the voltage difference that an input signal may have without leading to a particular incident on operation of a system.
Although the comparator with hysteresis was a major step forward in the mechanism to generate a comparison signal without instability, the second known technique does have the disadvantages that it is expensive in silicon surface area and is not very efficient. Hysteresis is typically adjusted to the maximum noise value that the signal to be observed is supposed to carry at the output from the slaving system (in other words the comparator input signal). This maximum noise value is particularly difficult to estimate since micro-controllers have been developed for a wide variety of applications and not for a specific application. It would be possible to implement adjustable analogue hysteresis on comparators. However, this would make this second technique according to prior art even more expensive in silicon surface area.
Another major disadvantage of this second known technique is due to the fact that hysteresis introduces a delay on availability of information, and this delay is additional to the time necessary for the slaving algorithm to adjust its actions on the system. Thus, this latency between equality of the input signal and the set value and the reaction of the system may reduce the precision of system control.